import { Component, Prop } from 'vue-facing-decorator'
import Render from '@/render/Render'
import toNative from '@/utils/toNative'
import TableRender, { type TableRenderColumnTypes } from '@/render/TableRender'
import type { VxeTableDataRow } from 'vxe-table'
import { Switch } from 'ant-design-vue'

@Component
export class workTypesTable extends TableRender {
    noTablePadding = true
    checked = true
    @Prop() title!: string
    tableColumnConfigOld = () => [
        {
            field: 'companyId',
            title: '系统可用工种',
        },
        {
            field: 'companyName',
            title: '风险等级',
        },
        {
            field: 'auditStatus',
            title: '状态',
        },
        
        {
            field: 'operate',
            title: '操作',
            width: 160,
            fixed: 'right',
            slots: {
                default: () => { 
                    return <div>
                        <Switch v-model:checked={ this.checked }></Switch>
                    </div>
                }
            }
        }
    ] as TableRenderColumnTypes<VxeTableDataRow>
    render() {
        return (
            <>
                {this.renderTable()}
            </>
        )
    }
}

export default toNative<{title:string}, {}>(workTypesTable)